<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<%@ include file="/common-app/taglibs.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
<style type="text/css">
<!--
.radio_css{
	BORDER-RIGHT: 0px solid #495172;
	PADDING-RIGHT: 1px;
	BORDER-TOP: 0px ridge #819AD2;
	PADDING-LEFT: 1px;
	FONT-SIZE: 9pt;
	PADDING-BOTTOM: 1px;
	BORDER-LEFT: 0px ridge #819AD2;
	COLOR: #0C2358;
	PADDING-TOP: 2px;
	BORDER-BOTTOM: 0px solid #495172;
	HEIGHT: 21px;
	BACKGROUND-COLOR: #FFFFFF;
}
-->
</style>

	<script type="text/javascript">
	var ctx = "${ctx}";
	var res = "${res}";
	var res_hn = "${res_app}";
</script>
	
<script type="text/javascript" src="${res_app}/js/app/kjt/public_kjt.js"></script>
	<script type="text/javascript" src="${res_app}/js/app/kjt/numericbox.js"></script>
	<link href="${res_app}/css/kjt/IchannelUi_kjt.css" rel="stylesheet" type="text/css" />
	<link href="${res_app}/css/kjt/TabContainer.css" rel="stylesheet" type="text/css">
	<link rel="stylesheet" type="text/css" media="all" href="${res_app}/css/kjt/calendar-crm-1.css" title="win2k-cold-1" />

	<script type="text/javascript" src="${res_app}/js/app/kjt/calendar.js"></script>  		
	<script type="text/javascript" src="${res_app}/js/app/kjt/calendar-zh.js"></script>	
	<script type="text/javascript" src="${res_app}/js/app/kjt/calendar-setup.js"></script>
	<script type="text/javascript">
		var djConfig = {isDebug: false};
	</script>
	<script type="text/javascript" src="${res_app}/js/app/kjt/dojo.js"></script>
	<script src="${res_app}/js/app/validate/irisvalidator.js" type="text/javascript"></script>
	<script src="${res_app}/js/app/kjt/irisdata.js" type="text/javascript"></script>
	<script src="${res_app}/js/app/proposal/irisPrpPrepare.js" type="text/javascript"></script>
	<script src="${res_app}/js/app/kjt/pagelock.js" type="text/javascript"></script>
	<script src="${res_app}/js/app/kjt/CheckBoxList.js"></script>
		<script src="${res_app}/js/app/kjt/msValidator.js" type="text/javascript"></script>
		<script src="${res_app}/js/app/kjt/msWebForm.js" type="text/javascript"></script>
		<script src="${res_app}/js/app/kjt/DropDownTree.js" type="text/javascript"></script>
		<link href="${res_app}/css/kjt/dojoTree.css" rel="stylesheet" type="text/css">
		<script src="${res_app}/js/app/kjt/sti_edit_irisdata.js" type="text/javascript"></script>
		<script src="${res_app}/js/app/kjt/sti_validator_1.js"></script>
		<script src="${res_app}/js/app/kjt/sti_public.js"></script>
	<script language="JavaScript" type="text/javascript">
		dojo.require("dojo.widget.FloatingPane");
		dojo.require("dojo.widget.Dialog");
		
	</script>
	<base target="_self">  
	
	<title><c:choose><c:when test="${param.grantType=='cgjd'}">参与单位所在省市列表</c:when><c:otherwise>买方地区列表</c:otherwise></c:choose></title>
	
  </head>
  
  <body>
			
			
<script language="JavaScript" type="text/javascript">
	/*
		创建XMLHttpRequest对象
		*/
		var xmlHttpRequest = null;
		function createXmlHttpRequest()
		{
   			if(window.ActiveXObject){//IE和其他的浏览器实现XMLHttpRequest的方式不同
      			xmlHttpRequest = new ActiveXObject("Microsoft.XMLHTTP");
   			}else{
      		xmlHttpRequest = new XMLHttpRequest();
   			}
		}
		/*
		ajax提交
  		*/
		function AjaxGetAreaName(area_no)
		{
			createXmlHttpRequest();//首先创建XMLHttpRequest对象
			var url = "/stms/ajax.do?DataType=ajaxGetAreaName&area_no="+area_no;
			xmlHttpRequest.onreadystatechange = doAjaxGetAreaName;//打开监听函数
			xmlHttpRequest.open('GET',url,true);
			xmlHttpRequest.send(null);
		}
		/*
  		创建监听函数
  		*/
		function doAjaxGetAreaName()
		{
   			if(xmlHttpRequest.readyState==4)
   			{
   				//完整的服务器响应已经收到
       			if(xmlHttpRequest.status==200)
       			{
       				//成功返回
	      			var area_name = xmlHttpRequest.responseText;
	      			try
					{
						//alert(area_name);
						var returnArray = new Array();
						
						returnArray[0] = document.getElementById("area_no").value;
						returnArray[1] = area_name;
						
						if(window.opener != undefined){
							window.opener.returnValue = returnArray;
						}else{
							window.returnValue = returnArray;
						}
						window.close();
					}
					catch(e)
					{}
	   			}
			}
		}
<!--
/*
	function selectValue(obj)
	{
		var objs = document.getElementsByTagName("INPUT");
		//var objs = document.getElementsByName(obj.name);
		for(var i=0;i<objs.length;i++)
		{
			if(objs[i].type == "checkbox")
			{
				objs[i].checked = false;
			}
			
		}
		obj.checked = true;
	}
*/
	function btn_cancel()
	{
		window.close();
	}
	function btn_ok()
	{
		var returnArray = new Array();
		
		var objs = document.getElementsByTagName("INPUT");
		var count = 0 ;
		for(var i=0;i<objs.length;i++)
		{
			count ++;
			if(objs[i].type == "radio")
			{
				if(objs[i].checked == true)
				{
					var id_ = objs[i].value;
					var value_ = dojo.byId("hid"+objs[i].value).value;
					returnArray[0] = id_;
					returnArray[1] = value_;
					document.getElementById("area_no").value = id_;
					AjaxGetAreaName(id_);
					return false;
					break;
				}
			}
			
		}
		
		if( count >= objs.length )
		{
			alert("请选择一个地区!");
			return false;
		}
		//alert(returnArray[0]+"|"+returnArray[1]);
		//window.returnValue = returnArray; 
		//window.close();
	}
	
	function on_load()
	{
		var objs = document.getElementsByTagName("INPUT");
		var currentNodeId = "${node.currentNodeId}";
		var cmd = "${node.cmd}";
		if( currentNodeId == "" || cmd == "" )
			return ;
		for(var i=0;i<objs.length;i++)
		{
			if(objs[i].type == "radio")
			{
				if( currentNodeId == objs[i].value )
				{
					objs[i].checked = true;
					break;
				}
			}
			
		}
	}
	dojo.addOnLoad(on_load);
//-->
</script>
			
		
			
			
			
	
			
											

	<br>

	<br>
	<input type="hidden" id="area_no" value = "">
	<table width="80%" align="center">
	
	<c:if test="${not empty node.parentNodeId or node.parentNodeId!=''}">
			<tr>
				<td>
		<a href="<%=request.getContextPath()%>/ajax.do?DataType=BuyerSiteData&cmd=open&nodeId=${node.parentNodeId}" >上一级</a>
		
				</td>
			</tr>
			<tr>
				<td>
						&nbsp;
				</td>
			</tr>
		
	</c:if>
	
	
	
			<tr>
				<td>
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="button" value="确定" onClick="btn_ok();">&nbsp;&nbsp;<input type="button" value="取消" onClick="btn_cancel();">
				</td>
			</tr>
			<tr>
				<td>
						&nbsp;
				</td>
			</tr>
		<c:forEach var="nodeItem" items="${node.nodeItems}">
			<tr>
				
				<td>
					<c:if test="${nodeItem.isHaveChild=='0'}">
						<img src="${res_app}/images/minus.gif" border="0"></img>
					</c:if>
					<c:if test="${nodeItem.isHaveChild=='1'}">
						<a href="<%=request.getContextPath()%>/ajax.do?DataType=BuyerSiteData&cmd=open&nodeId=${nodeItem.nodeId}">
							<img src="${res_app}/images/plus.gif" border="0"></img>
						</a>
					</c:if>
					<input type="hidden" id="hid${nodeItem.nodeId}" name="hid${nodeItem.nodeId}" value="${nodeItem.nodeName}">
					${nodeItem.nodeName}<input class="radio_css" type="radio"  name="chkRadio" value="${nodeItem.nodeId}">

					
					
				</td>
			</tr>

		</c:forEach>
			<tr>
				<td>
						&nbsp;
				</td>
			</tr>
			<tr>
				<td>
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="button" value="确定" onClick="btn_ok();">&nbsp;&nbsp;<input type="button" value="取消" onClick="btn_cancel();">
				</td>
			</tr>
			
			
	<c:if test="${not empty node.parentNodeId or node.parentNodeId!=''}">
			<tr>
				<td>
						&nbsp;
				</td>
			</tr>
			<tr>
				<td>
		<a href="<%=request.getContextPath()%>/ajax.do?DataType=BuyerSiteData&cmd=open&nodeId=${node.parentNodeId}" >上一级</a>
		
				</td>
			</tr>

		
	</c:if>
			
	</table>
	





  </body>
</html>
